<template>
  <div class="large-screen-dashboard">
    <div class="page-header">
      <h1>看板大屏幕链接</h1>
      <p>提供大屏幕展示的数据看板链接</p>
    </div>

    <div class="dashboard-content">
      <div class="screen-grid">
        <div class="screen-card">
          <div class="screen-preview">
            <div class="screen-header">
              <h3>基地种植面积大屏</h3>
              <span class="screen-status active">在线</span>
            </div>
            <div class="screen-content">
              <div class="preview-chart">
                <div class="chart-bars">
                  <div class="bar" style="height: 60%"></div>
                  <div class="bar" style="height: 80%"></div>
                  <div class="bar" style="height: 100%"></div>
                  <div class="bar" style="height: 70%"></div>
                  <div class="bar" style="height: 90%"></div>
                </div>
              </div>
            </div>
            <div class="screen-footer">
              <div class="screen-info">
                <span>分辨率: 1920x1080</span>
                <span>刷新率: 30s</span>
              </div>
              <div class="screen-actions">
                <button class="btn btn-primary">查看大屏</button>
                <button class="btn btn-secondary">编辑</button>
              </div>
            </div>
          </div>
        </div>

        <div class="screen-card">
          <div class="screen-preview">
            <div class="screen-header">
              <h3>补助概况大屏</h3>
              <span class="screen-status active">在线</span>
            </div>
            <div class="screen-content">
              <div class="preview-chart">
                <div class="pie-chart">
                  <div
                    class="pie-segment"
                    style="--angle: 40deg; --color: #1890ff"
                  ></div>
                  <div
                    class="pie-segment"
                    style="--angle: 30deg; --color: #52c41a"
                  ></div>
                  <div
                    class="pie-segment"
                    style="--angle: 20deg; --color: #fa8c16"
                  ></div>
                  <div
                    class="pie-segment"
                    style="--angle: 10deg; --color: #f5222d"
                  ></div>
                </div>
              </div>
            </div>
            <div class="screen-footer">
              <div class="screen-info">
                <span>分辨率: 1920x1080</span>
                <span>刷新率: 60s</span>
              </div>
              <div class="screen-actions">
                <button class="btn btn-primary">查看大屏</button>
                <button class="btn btn-secondary">编辑</button>
              </div>
            </div>
          </div>
        </div>

        <div class="screen-card">
          <div class="screen-preview">
            <div class="screen-header">
              <h3>城镇基地大屏</h3>
              <span class="screen-status offline">离线</span>
            </div>
            <div class="screen-content">
              <div class="preview-chart">
                <div class="map-preview">
                  <div class="map-dots">
                    <div class="dot" style="--color: #1890ff"></div>
                    <div class="dot" style="--color: #52c41a"></div>
                    <div class="dot" style="--color: #fa8c16"></div>
                    <div class="dot" style="--color: #f5222d"></div>
                  </div>
                </div>
              </div>
            </div>
            <div class="screen-footer">
              <div class="screen-info">
                <span>分辨率: 1920x1080</span>
                <span>刷新率: 45s</span>
              </div>
              <div class="screen-actions">
                <button class="btn btn-primary">查看大屏</button>
                <button class="btn btn-secondary">编辑</button>
              </div>
            </div>
          </div>
        </div>

        <div class="screen-card">
          <div class="screen-preview">
            <div class="screen-header">
              <h3>综合数据大屏</h3>
              <span class="screen-status active">在线</span>
            </div>
            <div class="screen-content">
              <div class="preview-chart">
                <div class="multi-chart">
                  <div class="chart-row">
                    <div class="mini-chart"></div>
                    <div class="mini-chart"></div>
                  </div>
                  <div class="chart-row">
                    <div class="mini-chart"></div>
                    <div class="mini-chart"></div>
                  </div>
                </div>
              </div>
            </div>
            <div class="screen-footer">
              <div class="screen-info">
                <span>分辨率: 1920x1080</span>
                <span>刷新率: 30s</span>
              </div>
              <div class="screen-actions">
                <button class="btn btn-primary">查看大屏</button>
                <button class="btn btn-secondary">编辑</button>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="screen-settings">
        <h3>大屏设置</h3>
        <div class="settings-grid">
          <div class="setting-item">
            <label>自动刷新</label>
            <div class="toggle-switch">
              <input type="checkbox" id="auto-refresh" checked />
              <label for="auto-refresh"></label>
            </div>
          </div>

          <div class="setting-item">
            <label>全屏模式</label>
            <div class="toggle-switch">
              <input type="checkbox" id="fullscreen" />
              <label for="fullscreen"></label>
            </div>
          </div>

          <div class="setting-item">
            <label>夜间模式</label>
            <div class="toggle-switch">
              <input type="checkbox" id="dark-mode" />
              <label for="dark-mode"></label>
            </div>
          </div>

          <div class="setting-item">
            <label>数据同步</label>
            <div class="toggle-switch">
              <input type="checkbox" id="data-sync" checked />
              <label for="data-sync"></label>
            </div>
          </div>
        </div>

        <div class="url-section">
          <h4>大屏链接</h4>
          <div class="url-list">
            <div class="url-item">
              <span class="url-label">基地种植面积:</span>
              <code class="url-code">https://farmweb.com/screen/planting</code>
              <button class="btn btn-small">复制</button>
            </div>
            <div class="url-item">
              <span class="url-label">补助概况:</span>
              <code class="url-code">https://farmweb.com/screen/subsidy</code>
              <button class="btn btn-small">复制</button>
            </div>
            <div class="url-item">
              <span class="url-label">城镇基地:</span>
              <code class="url-code">https://farmweb.com/screen/urban</code>
              <button class="btn btn-small">复制</button>
            </div>
            <div class="url-item">
              <span class="url-label">综合数据:</span>
              <code class="url-code">https://farmweb.com/screen/overview</code>
              <button class="btn btn-small">复制</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 看板大屏幕链接逻辑
</script>

<style scoped>
.large-screen-dashboard {
  padding: 24px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 28px;
  font-weight: 600;
}

.page-header p {
  margin: 0;
  color: #666;
  font-size: 16px;
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.screen-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.screen-preview {
  height: 400px;
  display: flex;
  flex-direction: column;
}

.screen-header {
  padding: 16px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.screen-header h3 {
  margin: 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.screen-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.screen-status.active {
  background: #f6ffed;
  color: #52c41a;
}

.screen-status.offline {
  background: #fff2f0;
  color: #ff4d4f;
}

.screen-content {
  flex: 1;
  padding: 20px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-chart {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 120px;
}

.bar {
  width: 20px;
  background: linear-gradient(to top, #1890ff, #69c0ff);
  border-radius: 2px 2px 0 0;
  min-height: 10px;
}

.pie-chart {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color) 0deg var(--angle),
    transparent var(--angle) 360deg
  );
}

.map-preview {
  width: 120px;
  height: 80px;
  background: #1a1a1a;
  border-radius: 8px;
  position: relative;
}

.map-dots {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--color);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color);
}

.multi-chart {
  width: 120px;
  height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-row {
  display: flex;
  gap: 8px;
  flex: 1;
}

.mini-chart {
  flex: 1;
  background: linear-gradient(45deg, #1890ff, #52c41a);
  border-radius: 4px;
}

.screen-footer {
  padding: 16px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.screen-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  color: #666;
}

.screen-actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: #1890ff;
  color: white;
}

.btn-primary:hover {
  background: #40a9ff;
}

.btn-secondary {
  background: #f0f0f0;
  color: #666;
}

.btn-secondary:hover {
  background: #d9d9d9;
}

.btn-small {
  padding: 4px 8px;
  font-size: 10px;
}

.screen-settings {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.screen-settings h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.setting-item label {
  color: #333;
  font-size: 14px;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}

.toggle-switch label:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.toggle-switch input:checked + label {
  background-color: #1890ff;
}

.toggle-switch input:checked + label:before {
  transform: translateX(20px);
}

.url-section h4 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.url-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.url-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.url-label {
  color: #333;
  font-size: 14px;
  font-weight: 500;
  min-width: 100px;
}

.url-code {
  flex: 1;
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #666;
  border: 1px solid #d9d9d9;
}

@media (max-width: 768px) {
  .screen-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .url-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .url-code {
    width: 100%;
  }
}
</style> 